import request from '@/utils/request'

// 创建题目分类
export function createSubjectCategory(data) {
  return request({
    url: '/exam/subject-category/create',
    method: 'post',
    data: data
  })
}

// 更新题目分类
export function updateSubjectCategory(data) {
  return request({
    url: '/exam/subject-category/update',
    method: 'put',
    data: data
  })
}

// 删除题目分类
export function deleteSubjectCategory(id) {
  return request({
    url: '/exam/subject-category/delete?id=' + id,
    method: 'delete'
  })
}

// 获得题目分类
export function getSubjectCategory(id) {
  return request({
    url: '/exam/subject-category/get?id=' + id,
    method: 'get'
  })
}

// 获得题目分类分页
export function getSubjectCategoryPage(query) {
  return request({
    url: '/exam/subject-category/page',
    method: 'get',
    params: query
  })
}

// 获取类目精简信息列表
export function getSimpleList(query) {
  return request({
    url: '/exam/subject-category/list-all-simple',
    method: 'get',
    params: query
  })
}

// 导出题目分类 Excel
export function exportSubjectCategoryExcel(query) {
  return request({
    url: '/exam/subject-category/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
